Skip to content

Use the stdlib Set for the compiler's sets - #8789

Merged
cknitt merged 2 commits into
stdlib-hashsetfrom
stdlib-set
Oct 11, 2026
Merged

cknitt merged 2 commits into
stdlib-hashsetfrom
stdlib-set

Conversation

@cknitt

@cknitt cknitt commented Oct 10, 2026

Copy link
Copy Markdown
Member

Third of four PRs moving the compiler's own collections onto the OCaml standard library, stacked on #8787. This one covers sets.

Set_ident, Set_int and Set_string are now Set.Make instances with the same comparison functions, including Ext_string.compare (length first) for strings, so iteration order is unchanged. Call sites use the stdlib argument order (Set_ident.add x s, Set_ident.mem x s, Set_ident.iter f s, …). Element and set types always differ, so the type checker verifies every flipped call. Ext_set and Set_gen are removed, together with the ounit tests of their balanced-tree invariants.

Output: byte-identical to #8787 on 628 files (Belt, all of tests/tests/src, and the benchmark stress inputs).

Performance: neutral (CPU −0.6%, allocation +0.35% vs master).

🤖 Generated with Claude Code

@cknitt
cknitt added this pull request to stack #8788 October 10, 2026 18:56
@pkg-pr-new

pkg-pr-new Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8789

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8789

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8789

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8789

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8789

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8789

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8789

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8789

commit: 1c97f29

@cknitt
cknitt marked this pull request as ready for review October 11, 2026 05:33
@cknitt

cknitt commented Oct 11, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T05:36:22.541127Z 5bae7ae Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 5bae7ae706

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cknitt
cknitt requested a review from cristianoc October 11, 2026 05:37
cknitt and others added 2 commits October 11, 2026 07:38
Set_ident, Set_int and Set_string are Set.Make instances with the same
comparisons; Ext_set and Set_gen are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Christoph Knittel <ck@cca.io>
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.81319% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.58%. Comparing base (9b8ce57) to head (1c97f29).

Files with missing lines Patch % Lines
compiler/core/lam_compile_main.ml 66.66% 3 Missing ⚠️
compiler/ml/parmatch.ml 50.00% 3 Missing ⚠️
compiler/ml/transl_recmodule.ml 50.00% 3 Missing ⚠️
compiler/ml/matching.ml 75.00% 1 Missing ⚠️
compiler/ml/mtype.ml 0.00% 1 Missing ⚠️
compiler/ml/record_runtime.ml 75.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           stdlib-hashset    #8789      +/-   ##
==================================================
- Coverage           80.64%   80.58%   -0.07%     
==================================================
  Files                 458      455       -3     
  Lines               62523    62231     -292     
==================================================
- Hits                50420    50147     -273     
+ Misses              12103    12084      -19     
Files with missing lines Coverage Δ
compiler/core/js_analyzer.ml 83.22% <100.00%> (ø)
compiler/core/js_dump.ml 92.84% <100.00%> (ø)
compiler/core/js_pass_flatten_and_mark_dead.ml 76.74% <ø> (ø)
compiler/core/js_pass_get_used.ml 96.15% <100.00%> (ø)
compiler/core/js_pass_scope.ml 98.48% <100.00%> (ø)
compiler/core/js_pass_tailcall_inline.ml 79.16% <ø> (ø)
compiler/core/js_shake.ml 86.11% <100.00%> (ø)
compiler/core/lam_check.ml 95.00% <100.00%> (ø)
compiler/core/lam_closure.ml 71.42% <100.00%> (ø)
compiler/core/lam_coercion.ml 97.50% <100.00%> (ø)
... and 20 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cknitt
cknitt merged commit 0c3608d into master Oct 11, 2026
24 checks passed
@cknitt
cknitt deleted the stdlib-set branch October 11, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants